log using "C:\Replication Results 031505.log", replace

**Table 1:  Summary of Treatment, Control, and Contact groups
clear
set mem 400m
set more off

use "C:\IA_MI_merge040504.dta"
tab treat_real contact  
tab treat_pseudo treatmen     /*values for treatmen=-1 and column marginals give relevant quantities*/


**Table 2: Covariate balance between Treatment and Control Groups
bysort state competiv treat_real: sum newreg vote00 vote98 female if   treat_real~=. /*Part A*/
bysort state competiv treat_pseudo: sum newreg vote00 vote98 female if   /*Part B*/


**Randomization Check
clear
set mem 700m
use "C:\IA_MI_merge040504.dta"
xi: logit treat_real vote00 vote98 female2 fem_miss newreg age persons i.st_hse if bad_county==0 & state==0 & competiv==1
logit treat_real vote00 vote98 female2 fem_miss newreg age persons _I* if bad_county==0 & state==0 & competiv==1
logit treat_real vote00 vote98 female2 fem_miss newreg age persons _I* if bad_county==0 & state==0 & competiv==2
logit treat_real vote00 vote98 female2 fem_miss newreg pid_maj age persons _I* if bad_county==0 & state==1 & competiv==1
logit treat_real vote00 vote98 female2 fem_miss newreg pid_maj age persons _I* if bad_county==0 & state==1 & competiv==2

logit pseudo_portion vote00 vote98 female2 fem_miss newreg age persons _I* if bad_county==0 & state==0 & competiv==1
logit pseudo_portion vote00 vote98 female2 fem_miss newreg age persons _I* if bad_county==0 & state==0 & competiv==2
logit pseudo_portion vote00 vote98 female2 fem_miss newreg pid_maj age persons _I* if bad_county==0 & state==1 & competiv==1
logit pseudo_portion vote00 vote98 female2 fem_miss newreg pid_maj age persons _I* if bad_county==0 & state==1 & competiv==2

clear
set mem 400m
use "C:\IA_MI_merge040504.dta"

**Table 3: Voting in 2002 as a Function of Previous Voting Behavior
bysort vote98: tab vote02 vote00 if bad_county==0, col


**Table 4:  Experimental Benchmark Estiamtes of the Effect of Phone Calls on Voter Turnout in Iowa and Michigan, 2002 (2SLS)

*No covariates, excluding non-working phones
ivreg vote02 (contact state comp_mi comp_ia = treat_real state comp_mi comp_ia), robust

*With Covariates, excluding non-working phones
ivreg vote02 (contact state comp_mi comp_ia persons age female2 newreg vote00 vote98 fem_miss _Ist_sen_2-_Ist_hse_81 _Ist_hse_83-_Icounty_99  = treat_real state comp_mi comp_ia persons age female2 newreg vote00 vote98 fem_miss _Ist_sen_2-_Ist_hse_81 _Ist_hse_83-_Icounty_99), robust

*No covariates, including non-working phones
ivreg vote02 (pseudo_c state comp_mi comp_ia = treat_pseudo state comp_mi comp_ia) , robust

*With Covariates, including non-working phones
ivreg vote02 (pseudo_c state comp_mi comp_ia persons age female2 newreg vote00 vote98 fem_miss _Ist_sen_2-_Ist_hse_81 _Ist_hse_83-_Icounty_99 = treat_pseudo state comp_mi comp_ia persons age female2 newreg vote00 vote98 fem_miss _Ist_sen_2-_Ist_hse_81 _Ist_hse_83-_Icounty_99), robust

*Exact Matches Only: Listed Sample
use "C:\IA_MI_merge_identicaldata2.dta", clear
drop if _matchesreal==0
xi: ivreg vote02 (contact i._ratioreal=treat_real i._ratioreal), robust

*Exact Matches Only: Unlisted Sample
use "C:\IA_MI_merge_identicaldata2.dta", clear
drop if _matchespseudo==0
xi: ivreg vote02 (pseudo_c i._ratiopseudo=treat_pseudo i._ratiopseudo), robust



**Table 5: OLS estimates
clear
set mem 900m
use "C:\IA_MI_merge040504.dta"

*No covariates, excluding non-working phones
reg vote02 contact state comp_mi comp_ia  , robust

*With Covariates, excluding non-working phones
xi: reg vote02 contact state comp_mi comp_ia persons age female2 newreg vote00 vote98 fem_miss i.county i.st_sen i.st_hse , robust

*No covariates, including non-working phones
reg vote02 pseudo_c state comp_mi comp_ia, robust

*With Covariates, including non-working phones
reg vote02 pseudo_c state comp_mi comp_ia persons age female2 newreg vote00 vote98 fem_miss _I*, robust

*Exact Matches Only: Listed Sample
use "C:\IA_MI_merge_identicaldata.dta", clear
drop if _matchesreal==0
xi: reg vote02 contact i._ratioreal, robust

*Exact Matches Only: Unlisted Sample
use "C:\IA_MI_merge_identicaldata.dta", clear
drop if _matchespseudo==0
xi: reg vote02 pseudo_c i._ratiopseudo, robust


**Table 6: Matching and OLS analyses for Contact Individuals
*OLS
clear
set mem 900m
use "C:\IA_MI_merge040504.dta"
xi: reg vote02 contact   age persons newreg competiv vote00 vote98 i.county i.st_sen i.st_hse female2 fem_miss state if bad_county==0 & vote00~=.
reg vote02 pseudo_c   age persons newreg competiv vote00 vote98 _I*  female2 fem_miss state  if bad_county==0 & vote00~=.
clear
set mem 400m

*Exact Matching
***Listed
use "C:\IA_MI_merge040504.dta", clear
drop if bad_county==1
drop if vote00==.
keep vote02 contact age  persons newreg competiv vote00 vote98 county st_sen st_hse female state
drop if contact==.
egen id=seq()

emindex vote02 contact age  persons newreg competiv vote00 vote98 county st_sen st_hse female state, id(id)
matchcalc  vote02 contact _eweight, id(id) index("C:\STATADATA\emindex_0_1.dta") exact(1) matches( _matches)
drop _*

***Unlisted
clear
use "C:\IA_MI_merge040504.dta", clear
drop if bad_county==1
drop if vote00==.
keep vote02 pseudo_c age  persons newreg competiv vote00 vote98 county st_sen st_hse female state
rename pseudo_c contact
egen id=seq()

emindex vote02 conatct age  persons newreg competiv vote00 vote98 county st_sen st_hse female state, id(id)
matchcalc  vote02 contact _eweight, id(id) index("C:\STATADATA\emindex_0_1.dta") exact(1) matches( _matches)
drop _*

*Inexact matching estimates
**Listed
use "C:\listedexact.dta", clear
matchcalc  vote02 contact _weight, id(id) index("C:\STATADATA\exvar.dta") exact(1) matches( _matches)

**Unlisted
clear
set mem 400m
use "C:\unlistedexact.dta", clear
matchcalc  vote02 contact _weight, id(id) index("C:\STATADATA\exvaruu.dta") exact(1) matches( _matches)


**Table 7: By Phone Bank: OLS and Matching
use "C:\IA_MI_merge040504.dta", clear
xi: reg vote02 contact age  persons newreg competiv vote00 vote98  i.county i.st_sen i.st_hse female2 fem_miss state if lc==1
xi: reg vote02 contact age  persons newreg competiv vote00 vote98  i.county i.st_sen i.st_hse female2 fem_miss state if hc==1
xi: reg vote02 pseudo_c age  persons newreg competiv vote00 vote98 i.county i.st_sen i.st_hse female2 fem_miss state if lc==1
xi: reg vote02 pseudo_c age  persons newreg competiv vote00 vote98 i.county i.st_sen i.st_hse female2 fem_miss state if hc==1

*Exact Matching
**Listed
clear 
set mem 300m
use "C:\IA_MI_merge040504.dta", clear
drop if bad_county==1
drop if vote00==.
keep vote02 contact age  persons newreg competiv vote00 vote98 county st_sen st_hse female state lc hc
drop if contact==.
egen id=seq()

preserve
drop if lc==0
emindex vote02 contact age  persons newreg competiv vote00 vote98 county st_sen st_hse female state, id(id)
*Low Contact Phone Bank
matchcalc  vote02 contact _eweight, id(id) index("C:\STATADATA\emindex_0_1.dta") exact(1) matches( _matches)
drop _*
restore

preserve 
drop if hc==0
emindex vote02 contact age  persons newreg competiv vote00 vote98 county st_sen st_hse female state, id(id)
*High Contact Phone Bank
matchcalc  vote02 contact _eweight, id(id) index("C:\STATADATA\emindex_0_1.dta") exact(1) matches( _matches)
drop _*
restore


**Unlisted
clear
use "C:\IA_MI_merge040504.dta", clear
drop if bad_county==1
drop if vote00==.
keep vote02 pseudo_c age  persons newreg competiv vote00 vote98 county st_sen st_hse female state lc hc
rename pseudo_c contact
egen id=seq()

preserve
drop if lc==0
emindex vote02 contact age  persons newreg competiv vote00 vote98 county st_sen st_hse female state, id(id)
*Low Contact Phone Bank
matchcalc  vote02 contact _eweight, id(id) index("C:\STATADATA\emindex_0_1.dta") exact(1) matches( _matches)
drop _*
restore

preserve 
drop if hc==0
emindex vote02 contact age  persons newreg competiv vote00 vote98 county st_sen st_hse female state, id(id)
*High Contact Phone Bank
matchcalc  vote02 contact _eweight, id(id) index("C:\STATADATA\emindex_0_1.dta") exact(1) matches( _matches)
drop _*
restore

*Inexact Matching
clear
set mem 400m
set more off

**Listed Sample
use "C:\listedexact_lc.dta", clear
*Low Contact
tab contact _matches
matchcalc vote02 contact _weight, id(id) index("C:\STATADATA\exvar_lc.dta") exact(1) matches(_matches)

use "C:\listedexact_hc.dta", clear
*High Contact
tab contact _matches
matchcalc vote02 contact _weight, id(id) index("C:\STATADATA\exvar_hc.dta") exact(1) matches(_matches)


**Unlisted Sample
use "C:\unlistedexact_lc.dta", clear
*Low Contact
tab contact _matches
matchcalc vote02 contact _weight, id(id) index("C:\STATADATA\exvaruu_lc.dta") exact(1) matches(_matches)

use "C:\unlistedexact_hc.dta", clear
*High Contact
tab contact _matches
matchcalc vote02 contact _weight, id(id) index("C:\STATADATA\exvaruuhc_hc.dta") exact(1) matches(_matches)



**By Phone Bank: 2SLS
*All Data
clear
set more off
set mem 900m
use "C:\IA_MI_merge_identicaldata_dummies.dta", clear

**LC/HC 2SLS estimates with covaraites

*LC
ivreg vote02 (pseudo_c state comp_mi comp_ia persons age female2 newreg vote00 vote98 fem_miss _Ist_sen_2-_Ist_hse_81 _Ist_hse_83-_Icounty_99 = treat_pseudo state comp_mi comp_ia persons age female2 newreg vote00 vote98 fem_miss _Ist_sen_2-_Ist_hse_81 _Ist_hse_83-_Icounty_99) if lc==1, robust
ereturn list
*HC
ivreg vote02 (pseudo_c state comp_mi comp_ia persons age female2 newreg vote00 vote98 fem_miss _Ist_sen_2-_Ist_hse_81 _Ist_hse_83-_Icounty_99 = treat_pseudo state comp_mi comp_ia persons age female2 newreg vote00 vote98 fem_miss _Ist_sen_2-_Ist_hse_81 _Ist_hse_83-_Icounty_99) if hc==1, robust
ereturn list

*LC
ivreg vote02 (contact state comp_mi comp_ia persons age female2 newreg vote00 vote98 fem_miss _Ist_sen_2-_Ist_hse_81 _Ist_hse_83-_Icounty_99  = treat_real state comp_mi comp_ia persons age female2 newreg vote00 vote98 fem_miss _Ist_sen_2-_Ist_hse_81 _Ist_hse_83-_Icounty_99) if lc==1, robust
ereturn list
*HC
ivreg vote02 (contact state comp_mi comp_ia persons age female2 newreg vote00 vote98 fem_miss _Ist_sen_2-_Ist_hse_81 _Ist_hse_83-_Icounty_99  = treat_real state comp_mi comp_ia persons age female2 newreg vote00 vote98 fem_miss _Ist_sen_2-_Ist_hse_81 _Ist_hse_83-_Icounty_99) if hc==1, robust
ereturn list


*Exact Matches
use "C:\IA_MI_merge_identicaldata2.dta", clear
drop if _matchesreal==0
xi: ivreg vote02 (contact i._ratioreal*=treat_real i.ratioreal) if lc==1, robust
xi: ivreg vote02 (contact i._ratioreal*=treat_real i.ratioreal) if hc==1, robust
use "C:\IA_MI_merge_identicaldata2.dta", clear
drop if _matchespseudo==0
xi: ivreg vote02 (pseudo_c i._ratiopseudo =treat_pseudo i.ratiopseudo) if lc==1, robust
xi: ivreg vote02 (pseudo_c i._ratiopseudo =treat_pseudo i.ratiopseudo) if hc==1, robust

log close








